package com.code.day01.object;
import com.code.day01.object.Phone;


public class Main {
    public static void main(String[] args) {
        Phone phone1 = new Phone(); //phone 栈中
        String msg = phone1.message();
        phone1.brand = "Apple";
        phone1.color = "Red";
        System.out.println(phone1);
        System.out.println(phone1.brand);
        System.out.println(phone1.color);
        Phone phone2 = new Phone();
        String msg2 = phone2.message();
        phone2.brand = "Xiaomi";
        phone2.color = "gold";
        System.out.println(phone2);
        System.out.println(phone2.brand);
        System.out.println(phone2.color);


        /*new Phone().brand = "Apple"; //堆中 取不出来
        phone.color = "Red";
        System.out.println(new Phone().brand);*/
    }
}
